package com.qidi.pojo;

import java.util.List;

/**
 * @author zhouXinBin
 * @create 2020-09-02-18:14
 */
public class Page<T> {
    public static final int PAGESIZE=4;
    private Integer pageNo;
    private Integer pageSize=PAGESIZE;
    private Integer pageTotal;
    private Integer TotalRecord;
    private List<T> pageData;
    private String url;

    public Page() {
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        if (pageNo<1){
            pageNo=1;
        }
        if (pageNo>pageTotal){
            pageNo=pageTotal;
        }
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize!=null){
            this.pageSize = pageSize;
        }
    }

    public Integer getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(Integer pageTotal) {
        this.pageTotal = pageTotal;
    }

    public Integer getTotalRecord() {
        return TotalRecord;
    }

    public void setTotalRecord(Integer totalRecord) {
        TotalRecord = totalRecord;
    }

    public List<T> getPageData() {
        return pageData;
    }

    public void setPageData(List<T> pageData) {
        this.pageData = pageData;
    }

    @Override
    public String toString() {
        return "Page{" +
                "pageNo=" + pageNo +
                ", pageSize=" + pageSize +
                ", pageTotal=" + pageTotal +
                ", TotalRecord=" + TotalRecord +
                ", pageData=" + pageData +
                ", url='" + url + '\'' +
                '}';
    }
}
